package cn.tedu.hotel.serve.mapper;

import cn.tedu.hotel.serve.pojo.entity.OrderState;
import cn.tedu.hotel.serve.pojo.vo.OrderStateVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface OrderStateMapper {
    /**
     * 新增订单时，添加支付状态
     * @param orderState
     * @return
     */
    int addOrderState(OrderState orderState);


    /**
     * 根据订单ID修改订单状态
     * @param state
     * @param orderId
     * @return
     */
    int updateOrderStateByOrderId(
            @Param("state") String state,
            @Param("orderId") Long orderId
    );

    /**
     * 根据订单Id查询订单状态信息
     * @param orderId
     * @return
     */
    OrderStateVO getOrderStateByOrderId(Long orderId);

}
